{% extends "base.html" %}

{% block css %}
<link rel="stylesheet" type="text/css" href="{{settings.URL_ROOT}}media/css/codewiki.css" />
<script type="text/javascript" src="{{settings.URL_ROOT}}media/js/jquery-1.3.2.js"></script>
{% endblock %}

{% block title %}Viewing: {{dirname}}{% endblock %}

{% block content %}
<p><a href="{{settings.URL_ROOT}}">home</a></p>

<h1>Viewing: {{dirname}}</h1>

{% if dirnameup %}
  <p>In directory <a href="{{settings.URL_ROOT}}codewiki/{{dirnameup}}">/{{dirnameup}}</a></p>
{% endif %}

<form method="post" action="">
<table class="dividers">
<tr><th>Scraper</th><th>Last modified</th><th>Last run</th></tr>
{% for scraperscript in scraperscripts %}
<tr>
  <td><a href="{% url codewikifile dirname=scraperscript.dirname, filename=scraperscript.filename %}">{{scraperscript.dirname}}/{{scraperscript.filename}}</a></td>
  <td>{{scraperscript.last_edit}}</td>
  <td>{{scraperscript.last_run}} <input type="submit" value="run"/></td>
</tr>
{% endfor %}
</table>
</form>

<form method="post" action="">
  {% if newfilename %}{{newfilename}}{% endif %}
  <input type="text" name="newfile">
  <input type="submit" value="New file (must end in .py)"/>
</form>


{% endblock %}
